bugfixes, jobad to 3.1.6