Thread closing - Fixes #25