Added return value for error in main.