Improved to_signed() function to handle values that are already properly negative.
Added guard to os.remove() call in stop().