Fix no return in function returning non-void