A loophole meant that there was nothing to stop him contesting it again, and in the resulting by-election he was elected with an increased majority.
There was nothing to stop him contesting it again. This was what a loophole meant. He was elected with an increased majority. This was in the resulting by-election.