Added errors to prevent bad programs.