Fixed bugs and Exceptions.