Removed some bugs.
Added 'exceptions'.