some little fixes for real world corrupted data.