fixed a bunch of small but very important errors