Fixes for various warnings and pedantic compiler errors.

Addresses #16