Pull request from my personal fork with a couple changes