Some fixes for sanity