Fixing out of range error.