Fixes to cypher math functions