Fixing issues spotted by Mark