Comments, cleanup and fix an error path. #1208