Fix Illegal string offset for PHP5.4