fix for issue #260; extended exception handler; some fixes