several improvements
Merge commit 'dded1f09b1b64e3d8f56f3d33385ddaec514ce4b'