Correctly check type of js object. Do not set default value when attributes? is false.