Fix lookup table creation and select