Release 3.1.1

Various bugfixes, minor additions