Main: added error mesages for typing