More error handling, and debugging some handling of empty or single entry input.