modified dipydoc.* and *format* : fixed several bugs + better error control