random lib fixes