Bug fix: overflow in compiler automatic static casting