Fixed issue #39
Fixed problems in PHP 5.6