Fix restore_pos problem