Updated exceptions and logging