Typos and bugs corrected