Fixed alias table name insertion when building JOIN ... ON ... query