Fixes stats queries