Fix coordinate detection in checkValidity.
Move "rediscover_molecules" call to *right* after we prune empty residues, so
that the rest of the topology rebuilding is done using the "corrected" atom
order.