Fixes bug in table naming