Fixes for maxindex