Fix hardcoded parameters and improve error management