Fix bug with early return