Added null checking in deletion of variables in observations

Reviewer: Daniel Jao (post-commit)

Issue: None