Fix Build and Update memory flags

Change-Id: Ie5deb2348fabe8a469aea38a713db077d16a07d4