Small bug fixes detected by Linux gcc