Minor bug fix

Fixed a couple of similar bugs on lines 183 and 520. I've seen that type of syntax in javascript but never in PHP. In my case it didn't work so I modified it slightly.