Add tests where a pid is explicitly passed

Add tests for functions that now directly a pid.