cope with newer versions of www/sope. While touching it, a few minor bug fixes and enhancements from upstream are included.