Bug counter and input fixed