Fixed the viewer connection behaviour so it is exactly like the viewer
node does in nuke.
Also fixed a potential overflow in ViewerInstance