Added regression tests for feature request #47 and patch #1268.