Fixed volume.
Fixed 2 nasty bugs which only occurs in debug mode.