Bugs

I fixed numerous bugs.