fixed two bugs, #66 also