Small fixes, improved testing.