Fix bugs with payment calculation, more command interpreter code.