Bugfixes: string representation on error, toolkit handling, find_ancestor improvements