Cleanups and testing