Better debugging output, fix event adding bug