Fixes to stub code