Fixed 32bit counter boundary

Issue  #545