added missing directories, createdb permission and fixed git if