Assorted fixxes

- I suppose most of them ere for lua and core dumps