Fixing fatal error when saving settings in WordPress in certain situations