Fixed typo in previous update
Fixed logic bug introduced in previous change