Load modules for ports lazily, should fix #793
Remove unused import