fix bug with list indexes not raising exception when it should
fix problem with outputting file