Modified attribute if condition to comply with test suite and added required tests for the new piece of functionality.