Fixed String out of bounds error and fixed bug in insertion method.