Bugfix: empty graph won't throw ArithmeticException anymore