Sort requirements, fix #1031.
Add tests according to issue #931.
Merge pull request #1058 from normanjaeckel/Tests_931

Add tests according to issue #931.
Merge pull request #1056 from normanjaeckel/SortRequirements

Sort requirements, fix #1031.