Improve php5.2 compatibility. fixes #91

By improve, I mean don't die a sad an only death when activated on php5.2