Fixed Insert function.