cleaned up some code after warnings for OSX compiler candidate (thanks to Brian Ripley)