Updates to model and bugfixes