Added exception handling.
Merge branch 'rasmus2' into development