Fix iframe creation and finding code