Bug fixes

Fixed some potentially severe bugs, where wrong indices could lead to
index-out-of-bounds errors in Fortran.

Also fixed a bug in Python where the neighbor lists were not
necessarily reset even if full core initialization was required.