Fix handling of nil

Automatically set number to 0 when nil is passed in.