fixed small bugs introduced in last commit