Corrected handling of booleans, false=0 (not -1 as assumed at one place in the code). Print a bool string instead of 0/1 when printing booleans