Fix table selector generation