fix unused variable warnings and constructor ordering
Merge pull request #1545 from birarda/master

some warning fixes