Applied changes done by @christopherhein on branch master.