Reordered code in ligand::evaluate to avoid statement unreachable warning