Fixing null references, adding delete all of type