Fixed some bugs in the viewer wait conditions.