Adds better error handling for FromLocal method