Fix various front-end bugs.