Use get to avoid an error when the function loses the retcode

Fix #4267