debugging outputs for ref counting, writing flag fixed. GET while PUT tested.