Multiple fixes and tests