Fixed a few logic errors in the metadata query fix. Removed quote around string %@. Fixed issues with the order of arguments.