Dan's fixes for payment system issues