Some changes to improve multi platform support