Fix lookup, improve error messages and add one more test case