Bugfixes

Bug fix when having an empty model that causes crashes.