Move the guard before the use of metaclass.
Merge pull request #1180 from DatekWireless/master

Move the guard before the use of metaclass.