debug: add static keyword to avoid notices
fix unreliable event.target by always going up the chain and back down

fixes #346