Fixed the ReturnCommand to prevent any future memory leaks.