Attempt to fix behaviour when changing keys quickly