Fixing #16 and #21

Fixing the dereference incompatibility for PHP versions <5.4.