Further improvements to build system & alloc check

We use memalloc, and check for it properly