Added logging
Made null keys ok.