Minor simplification #3; use macros for ring buffer arithmetic. Also fixed unlikely...