initialize variable for Mac OS X to stop compiler complaints
Some bug fixes as seen in some pull requests