Fixed a deadlock and added some documentation