Added workaround for the bad __bool__ implementation