Added test for direct looked up. Fixed bug in it by correct offset key condition. Fixes #2393.