Better error handling and support for booleans