fixed compiler errors and redefinitions