Fixed all bugs after testing.