Fixed bug in detaching event listeners
Added collection shuffling and error checking to example file