Fixing an out of bounds exception and getting rid of some obsolete references