Fix bug with wrong changing of line types