Fix bug when using popcount() with ulong