Added error building, bugfixes and updated tests for save