Finished with fixes

Take a look at the changes before I merge to master and let me know if you have any concerns.