fixes for undefined and null being treated differently in Math methods