Restored collapse/expand functionality