bugfixes and model error