Gemini Rue AGS Mac/Linux port fixes (rebased)

Replacement for pull #108