Fixed some issues reported by winapi_check.