Fixed cursor position when editing card and added test for card update