Make frame calculations more consistent, trying to fix disappearing window issue on 10.9

Also includes a safety valve fix which will log to console if triggered