Updated to fix PHP 5.5 undefined index errors on associative arrays.