cleanups: Use correct types for some cleanup functions.