(Manual) rebase of pull request #261 from aspezia