Fixes onUnload not being called on disconnect.
Adds parens to side-effecting functions.