Exception handling & bugfixes