Updated minor palloc things, flags should be handled