Fix build with 2.066 and a runtime fix

Just some small fixes here.