Namespacing of custom events (fix for #333)