fixes and improvements (support for model-building only)