Added check for frameId conflict and minor changes.