Small fixes, few tests