Fixes after code review by Shauren.