Fixes some bugs.
Adds a hotfix, will be changed in later commits.