Fix error when deleting workspaces.

Refs #8316.
Merge remote-tracking branch 'origin/feature/8316_error_deleting_workspaces'