Fix bug with lookup tables

Revert #89, due to #101.