Fix for Activity/Stab Ops/EMS legacy bug

Also did a little refactoring and added frame type enumeration.