Fix for index conversion