fixed some crate bugs