This closes issues #724, #566 and #613