Fixed document deletion