Fixed warnings

And made some warnings into errors.