Also including changes from master's 98684ac4abfa781320fdd1ae39babb6adcd12364