fixed bugs preventing programm from compiling