Fixed undefined table prefix variable
Fixed undefined index
Fixed undefined index