Fix bug with save options and cleanup code.