Fixed some logic on occurrence handling