Fixes to mockprograms
Merge branch 'master' into api-query-tests