Review fixes, plus other bits for error handling