Fixed bug causing the wrong values to be written. Needs Apple deployment.