Fix double minuses and minus before zero bugs