Editor: Moved try/catch to inside the condition. Clean up.