DDF-660: Fixed metacard ID issue; added unit test