- Modified unit tests after the #956 fix.
- Added tests for bug #1006 (thanks to Louis-Claude Canon).