Fixed a bug that was causing php warnings.