- Added checks when rotating and scaling for avoiding divisions by zero.