Fix WINCH routine, convert into anonymous sub