CODE REVIEW: Style and minor code fixes