Made changes suggested in comments