Avoid division by zero (thanks to David Ronis).