*8996* Porting stats fixes

I just meant the cast to boolean seems odd for a test. I thought it would be more expressive to use a function that returns a boolean instead. Your implementation works though.