fixes #1274, fixes #1269