Code cleanup from Erik's review.