Fixed memory and serial issues