Add unit test + fix command error