fixed some ckport warnings about poissible buffer overflows which are not possible because buffer length is ensured before the call