Fixed column counter to work properly with indexes