database minor fixes