Fixes for PHP 5.3; mainly, store variables first, then access child variables.