There is something going on with the Max function when used inside a function definition. See attached:
href="/uploads/default/original/1X/107e9f2e5f2bd93a30e5e43316bce1f19e7006b6.math">MaxBug.math (1.2 KB)
"if" is acting a bit weird too.
Sorry for the delay in responding.
Could you email me this file? It looks like there was an issue on the forums when you tried to upload it.