Fixed NPE for newly created db