fixed boolean castings to/from api python equivalents.