test and fix #1079