Fixes from pull request