Fix for GitHub issue #1 (Mongoose "Undefined type" error)

Fix for issue #1.