Backported fixes and new feature