Fixes issue 401 which causes error when nested form created programatically by code or third-party library