Handle boolean values and fix bug when value is 0