Properly unwrap encoder before passing to control function.