Embarrassing fixes and tests