Fix the cleanup with boolean values #49

Added an additional check for boolean values.

Issue #49.