Added exceptions handlers
Comments
Fixed qtotal var name
Comment
Fixed qtotal var