Fixing tests and rebasing on master