Changed exceptions, optimized imports