fixed infrastructure after testing; lots of small fixes