Fix prepare_command