Don't treat bools as integers for casting (#478)