Fix sign extension issue

Found by Coverity Scan