Fixed problem with marking, copying and cutting going out of bounds