a few small bugs

Change-Id: I3448c6227ef9ca9effbd765a19c01d89c67c19c2