Some fixes unrelated to the other PR