Boolean cast fixes

Object should be converted to false if has no properties. I don't know how to implement this.