Fix opbeat, and some tests