Fixes for cross-compile; simplify Counter again