Adds Tests, Fixes Behaviour