Fixed possible bug with inserting null after deletion.