Fixed unassigned variable error in Firefox.
Did some tweaks to the pageReadinessListener.