Fixes bug #911663
The None, True, and False values are singletons.
All variable *comparisons* to singletons should use 'is' or 'is not'.
All variable *evaluations* to boolean should use 'if' or 'if not'.
All Object type comparisons should use isinstance()
instead of comparing types directly.
Change-Id: Id5c797d3339d0d7015bac386088133540f0c0c9e