bug fixes, now it compiles again