Fixed broken tests
Release 5.1.1
Merge branch 'master' into dev/document.templates