Added try:except to handle inexistent dbs directory.
Now handles inexistent 'log' and 'dbs' dirs.