More robustly validate signature inputs, closes #313