Fixed some issues discovered when building PHP API example program