Bug fixes + cleanups.