fixed bugs in trestle