Fixed an out of bounds exception and removed factory method ambiguity.