Misc changes to be compatible with PHP5.3 on aiapoiss.ee