Removed some crash bugs