fixed directory problem with database
various simple fixes