Fixed bug where preview did not disappear when it was supposed to, and added a missing comment.