bugfixes to all models and functions; calculations of theta now work properly