The fix in #1101 fixed the build but it produces an image that could not run. The PR fixes that as well. Ref #1099