Fixed loopholes that could cause errors in the commands