Some messy attempts to reduce the amount of boxing of booleans that went on