Merge pull request #173 from ElementalAlchemist/last-minute-patches

Last minute patches, part 2
Prevent crashing on invalid CAP commands