Fix handling of dynamic weaving imports with invalid syntax