Fixed bug where NPCs ignored walls

Also added unit test to verify expected behaviour