fix two minor bugs