Rebase and fix #438

Just some minor test fixes.