Cleaned up samples. Fixed bugs.