Fixed "Illegal string offset".

This error occurs in php 5.4.0 and higher.