Multiple calculation errors fixed