bug fix, small cleanup