Bug fixing, proper error management