Fixed crashing on deletion and space bars