Fixed a problem with htmlentities and older PHP versions (#212)