Added basic tests + cleanups.