Wrote frontend tests, fixed some small bugs.