Further fixes based on code review.