Fix remaining tests and code adjustments.