adjusting buffer sizes and checks to avoid assert