Fix event return codes and related tests

Return codes are always undefined otherwise.