Fixes to pr668 pr669

Fixes made while testing chain validation with @srimanob