Code debugged

Minor revision of recent code.