fixed a subtle bug in the standard library