Fixing nuget package, and improving error handling.