Another issue with cached imports. Fixes #1546