Fixed a NullReferenceException and cleaned processes up a bit