Cleaninng up of errors