improved memory management and fixed GLP-Headers