couple of changes to better handle installation from source
merged from upstream