Cleans up bad pid files

Woops! Sorry. Not ready for merging. Closing...