Fixed the nullPointerException related to Short truncation