Error handling and fix for relative input path