Fixed occurring panic when count is zero