* Fix issue1766 and add test case * Address review comments * Updated copyright year * Resolve merge conflicts