Fixed: more consistent exception handling