Cleanups & bug fixes.