PROV-913: Fixes for PHP 5.3

+ Incorrect variable and class contexts.
+ Retrieving element of array returned from function directly, without local variable.