Fixed mixup between empty() and clear() so memory is realesed correctly
Merge pull request #398 from BugFreeSoftware/fix_cmd

Fixed mixup between empty() and clear() so memory is realesed correctly