Replaced access of __dict__ with vars() call.