Fixes based on code review (Thanks Sean).