fixes from pull request and some code notes