More cleaning & fix things broken by moving code.