Fix countbars and added testing