Fixing handle creation from external form to be backward compatible.
(cherry picked from commit 3cb6d4718c946e382ed323cfd411ca1e81224b62)