PHP fixes.
Merge pull request #85 from mrunalp/dev/cartridge_refactor

PHP fixes.