Minor error fixes and code changes

Some for tests
Change from db to global varable
Keep moving db to global vars
Merge branch 'master' of https://github.com/khanh111/zuck

Conflicts:
	schema.js