several bugfixes concerning loading from file