some fixes for import
a fix for 'when' on events