Fix problems with save code