More tests and minor patching to make things pass