Make the code a bit more portable