Fix so loop isn't called if registerElements is empty