many changes to support tests and intermagnet