small patches to recent 3.1.5 library changes