Shading problems fixed and some exception handling added