Merge pull request #4269 from pks-t/pks/tests

Test improvements