Some bugfixes to fit tests