Finalized a lot of small bugs.