Console Encoding and runtime build fixes