Fixed diagonal bug