Fixed some bugs and added a save command