Some bugs fixed

Some bugs fixed, but a lot of others have left