Corrected some Bugs - still more in code