Bugfix: infinite calculation loop