Fixed #24 event duplication

Found 2 PHP bugs with this Commit