Fixes some code issues post code review by @sindresorhus