fix setting of restriction end nodes, fixes #1286, and potentially #1287