Tests and rules fixed