Franck's changes, bug fixes