Lot of changes, messy commit.