Fixing tests and complexity issues
Merge branch 'master' into github