Fixed path issues, Now exits properly when closed externally.