Fix table name
Fix syntax and update type