Fixed wrong exceptions.