Fixed userprog compile errors & some warnings