Fixed bug causing automatic viewmodel cleanup to not work properly