Escape bad event names
Add tests