first round of build fixes since merging develop. win32 still has problems.