Fix tryExtend, other minor bugs