Fixed up pid functions.

This addresses issue #11.