Test fixups and correction for #317