Also add a unit test related to #3427 Also improve the description text in checkclass and remove unused variable.
Added a safety check to ensure that a 'previous()' call doesn't crash (not sure if it's needed or not).