Merge design branch. Fix bugs.