Bug fix

Prevent modulo by 0.