Cleanup and small fixes.