Restore changes accidentally overwritten by Manu

Manu's changes in e35b2acd997c4a15e4c6957610510df2ed89f329, e8972c75b46289f84ee0666c8661acf357aa0261, and e8972c75b46289f84ee0666c8661acf357aa0261 were based on an outdated version. This restores the lost changes while maintaining Manu's edits.

After discussing it with Manu, I also updated the authors and added @niklasl instead of Mark Birbeck.