Provide access to context
Moved to new error-checking macro and fixed conversion warnings
Windows crappiness