Fixed a few rounding errors in some of the functions

Signed-off-by: Arné Schreuder <arn3@arn3.com>