Added type deletion and some fixes