For #1055: bug-fixes