Various fixes and a broken testing attempt.