catalonia maintained its loyalty to the king