Fix bug where deletePath would fail on directories with files in them
Fix bug from using array brackets on the returned value from a function; e.g. ->method()[index]
Fix bug with inline function; not allowed by PHP 5.2
Replace use of is_a() with instanceof

For some unknown reason, PHP 5.2 deprecated is_a() which raises errors; then they undeprecated it in 5.4...