Rewrite QPs to work with Bg. Write Lookup test. Lookup test passed.