startup events

added the startup events, plus a few minor fixes