Fixing up some notices, and replacing another trigger_error