Add changed from Robert, make it work under Linux