improved boolean parsing