Better error handling on instance lookup