Children were getting negative allocations by misusage of MAX() macro (bad signedness of expressions).