Patch to improve error recovery and put a limit on assembly buffer size