Fix for integer index error