handle nil as well as false

because tonumber doesn't :(
Merge pull request #17 from rootlsuer/master

handle nil as well as false