Fixing PHP Notices in getItems