Safer way to increment counter for QPS

See #13