Fixed a few PHP warnings. Thanks Martin Adamko!