Adjusting script initiatialization sequence for better compatiblity.