Closes #1056 and #1057