Modified handling of zero div problem