Clean up some partial functions