Fix undefined /0 errors