More tests & fixes