fix missing headers, enable more verbose debugging