Fixed buggy code

Fixed some awful PHP in the previous commit.