For ENG-6546, fix casting pain by casting to Number instead of Integer or Long