Attempt at debugging extra return problem