Fix casting Long into Integer