Added the database creation task and fixed some issues