Fix tests and clean whitespace