Fix for #153 backported from events branch
Merge remote-tracking branch 'origin/master'