Fix a bug where a bool property changed to an int property due to bad casting