Added support for larger buffer. Max 16384.