Add delete tests
Fix null reference exception