Some fixes based on pull request feedback