merge by hand and improve PR #710