Fix for magic import
Better error handling for unittest
More path fixes