Adding validation to CSV input. Fixes #23.