Minor bugfixes for PHP backword compatibility.

Wrong file name was used to throw exception