buffer events; fix a bunch of issues