handle true/false values more reliably