Assorted bug fix.