fixes #1310
implements #1332
fixes #1103; fixes #1297