Merged udpates from memory repo.
Further updates, some fixes.