Fix compile issues, fix tests, add additional utilities