Cleanup, bug fixes.