Made box things not spawn close to each other.
Made getEntity return the closest rather than first-found in an area.
Got rid of useless bitfiddling.
Make sure the Level exists before we try to modify it.

This solves one source of segfaults.