Minor fixes
Finding some major deadlock problems