Added header for crypto buffer and some minot fixes to code that uses it.