Fix cast of boolean where cast of LHS intended.

Closes #74.