Moved around some properties.
Made sure all threads were terminated after the main form has been closed.