Small improved implementations and fixes