Improve stability of unit tests

The Travis builds do not go through cleanly. I identified and removed 2 problems. All my Travis builds of this branch had green status.

More information are included in the individual commit messages.