Formatted code, fixed messages