don't add key to DB if null; half-fix tests