Fixed incorrect conversion to/from Logicals.