fixed several compilation issues introduced by latest commit