Fix bug in setting up of kspace