Fixed wrong exception catching
Updated, closes #1