Fix [] so it works on older versions of PHP

Also fix some coding style stuff.