Minor cleanup. and a bug fix