Adding tests, and fixing bugs immediately after.