added check for minimal quad size to avoid divisions through zero (closes #487)