Added complexity calculation bugfix.