Bugfixes to yarn branch

Multiple bugfixes to yarn branch, as mentioned in the commit messages