Fix first sample and get rid of memory leaks.