a few fixes to Tristram.js