Cleanup import refactoring

Bug fixes for #120