Fixed some front-end bugs. Edit database schema