Merge v4.0.0 bugfixes into develop branch
Since the release_v4.0.0 branch and develop had diverged too much, we had so manually solve the merge conflicts with develop. I fixed those merge conflicts to keep both the bugfixes of release_v4.0.0 and the logging of develop intact. Please do check whether everything still works as expected tho