Removed unused debugging
Fixed buffer sharing