Some lib fixes