Removed debug stuff and fixed a saving bug