better widechar support, fixed overreads, and added bounds (n) put functions