Fix workspaces controller and repository