Fixing autocalculation