Added volatile elements.
Fixed bug with volatile.