Math fixes for phobos unittests.