Reworked the way memory is specified for all the targets.