Minor cleanups, and make sure swViewportEvent deals in a unique callback ID.