Workaround for dartbug 14813, misc cleanup