Fixing many minor issues
Merge branch 'refactoring-promises'