Fixed zero division bug