Merge pull request #3786 from dumganhar/master

[master] Marmalade fixes
[master] Windows compilation fix.