bug fixes, add short/long buffer