Fix #1003
Replace throwable catch by exception
Merge pull request #1007 from emmanuel-keller/1.6

Bug fix and improvement