Fixed a couple compiler warnings

Original code from pull request #151