Some fixes to tables and mapping