Fix obvious divide by zero bug. Clarify an if statement.