Cleanup. Fix some gcc warnings. Fixed demo list memory corruption.