Bugs fixed in debug