#40 - Initial patch provided by @MinnieTheMoocher