Writing pose to file update, bug fix