Can format function & minor corrections to pids