a lot of bug(/stupidity)fixes