Made code more libstd compatible