Fixed an access violation bug that was caused by trying to remove periodic
boundary conditions.