Cleanup the code style
Reset result ring buffer when idle