Moved error checking to all happen before load_table()