Fixed a dom timing issue with composition complete callbacks.