Fixing bugs and cleaning code.