model bugfixes