Removing division by zero problems