Fixed particle coordinate calculations for non-cube shaped grids. This change fixes weird boundary issues non-cube grids sometimes had.