[BUGFIX] A few bugfixes