Fix codes for pat