some minor fixes on math