Fix all compiler warnings (resolves #320)