Adapted code and test to all platforms