Fix rubble digging and refactor relevent code a bit