Changed some open calls from 2 to 3 arguments,
and added a few missing "die" messages