Fixed all crash bugs