redmine 4698, 5638 and related tickets