Fix compile, but with runtime errors... work in progress