Royal Bug Fix

Fixed a bug in the royalty helper function that caused an exception when
a product was in the maintenance phase and making money.