char buffer fixes