Adjusted session overlay code.