fixed several compile errors/warnings; reacted on the PR comments