emx improvments and bug fixes