Fix an issue that threw PHP warnings 'empty substring'