Fixes some small bugs with sending events to Java (added second argument)