Large amount of bugs fixed