Code cleanup.
Added isObject and isNotObject functions.