Adds handling for boolean to numerical value mapping.

I came across some places where the num function was getting called with input being a boolean (the field in question includes TRUE / FALSE as a value in the Google spreadsheet). I'm not sure this is a correct solution to handling the case correctly but there goes.