A lot of bug fixes...

Related to 1-to-1 changes