Fixed potential double-return bug