Cleaner error handling in fixempties().