Fixed a recursive error in the API export code.