fixes for various nits found by @RaymondLim in code review.