Make length calculation work right

It's amazing what a misplaced parenthesis will do to you.