Fix #1941 - allow wrapping around in the list of programs