added full compatibility for wrap-around levels in EM engine