Close stream in finally block, increase buffer size, detect crx via magic number