Add a20 support and fix a memory bug