Added new error handling.
Changed the Errorhandling. Errors are now written to stderr.