Better handling of boolean conversion
More debug output