Backport to API 7. fix #5