Updated locked check for 5.5.3 'Locked' state removal. Trailing whitespaces were trimmed on some lines