Fix for GH #518 - Missing Error.h and int.

Full fix for #518 and #326
Partial fix for #486