Better sanity checking all around

See https://github.com/GigaOM/legacy-pro/issues/2085