fixed segfault
changed accessor
fixed test class