Fixed some problems with lookup tables.