Fixes to EM, hopefully now all working.