code snippet fixes