Fixed some bugs in the web package. Not all of them are fixed yet.