Fixed 2 crashes