Fixes some bugs revealed in functional tests
Merge branch 'master' of github.com:ekylibre/ekylibre