Remove invalid packagenames and don't try to test import them. Fix packages logic mixed with possibility of invalid names.