Also including changes from master's 90e58dc15c26d7389af80bf08ed99526adb99e67