Fixed BadImageFormatException when the argument to check was a generic parameter. Thanks to LordDawnhunter for giving me a reproducable example.