bugfix: empty graph due to incorrect current_position calculation

Also, improved failsafe for empty DAG, which should probably be producing a
warning message.