Several bug fixes...