Fixes to pseudocode