minor bug fixes in weight calculation
small bux fixes