importing modules
various general and compat fixes