Fixed issue with models being null. Fixes #133