Fixed a bug in viewer that made it not work at all