Some
Some integrity checks and added a stop() function