Fix the order of comment cleanup

Should clean up from the last view/form added to the most recent.
Also should check that the element exists before trying to clean
it up.