Some bugfix; documenting some of the issues we had.