Fixing stupid mistake (needed to cast long to int)