Adds a test to replicate the complete related bug
Fixes the complete related buggy behaviour