Fixed bugs with table