Adding some tables and fixing an undef bug