Corrected bugs for connection in J and K directions