@sjcorbett any ideas? Also, can you cast your eye over the rest of this PR - especially the javascript.