Some Bugs fixed