Some bug fixes and testing of save function.
Saving should now work.
Slight fixes, preperation.