Fixes based on @peterflynn's feedback.