Updated Main class.

Changed the main class a bit to detect the errors of the new API.