Better error on missing import

Fixes: #1436