Improved permission checking for publish functions; better handling of contemporaneous events.