fixed typos and a serious bug caused by order-of-arguments