Fixes #5451  by stealing JimTheCactus' and VampyrBytes' work - thanks dudes.
Minor name fix from VampyreBytes/Paradise.