Fixed import, relations, internal logging that can be turned off.