Fix local profile code