Rebased master onto Lucas' pull request