Added more delete functions and bug fixes.