Fixed some bugs regarding the tape and cmd flag handling