Bug-fix: graph cleared on empty input