Geometry bug fix

Fixed truncation errors in certain geometry functions