Bugs corrected
minor bugs