Improved handling of onevents etc