Fixed warning about implicit printf.
Added refresh callback.
Added window close callback.
Removed inconsistent logging in events test.