Fixed a bug in CustomIntegrator related to atom reordering