Fixes

please refer to the commit messages