fix exceptions thrown by SentenceMotion and ParagraphMotion when moving from the last line
add line range check for paragraph text object