Fixed rulefile directory deletion bug. Fixes #1