Fixed crashing errors and formatting errors.