Added compatibility with EE 2.6+. (Thanks ThatDeadPixel!)