Thoroughly done with main class error handling.