Add checks for bad imports; add import test