Fixed issues from gholms code review