Fix naming problems in royalties calculations