Several fixes.

- several minor fixes