Fix math stuff