Fixed a bug with saving things to file