Fix for overflow, similar to NCBC-692