Fixed incorrect exception thrown for missing EM