Added more error handling to converter