Fixed rule parsing, fixed bug in pattern class where coordinates were
reversed