Fixed bugs in stdlib