Updates based on kballard's feedback.