Fix some warnings

Just some various warning fixes.
Why would you cast this to int instead of using `%lu`?