Bug fixes.

Fully working.