Cleaned error messages. Added tests for lookup table.