Fixed bugs including some related to imports.