Fixed some JSON-related bugs and refined the comments controller.