DEVIDM-95: Some flow modifications, error handling and other minor changes.